﻿
@{
    ViewBag.Title = "商户管理";
    Layout = "~/Views/Shared/_Content.cshtml";
    var time = DateTime.Now;
    var beginTime = time;
    var endTime = time;

    var paytypelist = new HmPMer.Business.PayBll().GetPayTypeList();
    var agentList = new HmPMer.Business.UserBaseBll().GetUserBaseForType(2);
    var adminlist = new HmPMer.Business.AccountBll().GetAllHmAdmin();
    var IBList = new HmPMer.Business.InterfaceBll().GetInterfaceBusinessList(-1);
    var adminId = HmPMer.WebAdminUI.Models.ModelCommon.GetUserModel().ID;

}

@section HeadSection{
    <script src="/Scripts/jquery-1.8.3.min.js?@ViewBag.StaticVersion"></script>
    <script src="/Scripts/Order/orderlist.js?@ViewBag.StaticVersion"></script>
    <script src="/Scripts/My97DatePicker/WdatePicker.js?@ViewBag.StaticVersion"></script>
    <style>
        .f-red {
            color: red;
            font-size: 14px;
            margin-right: 3px;
        }

        .magleft10 {
            margin-left: 5px;
        }

        .layui-input-inline {
            margin-top: 3px;
        }
    </style>

}

<div class="layui-form">
    <blockquote class="layui-elem-quote quoteBox">
        <form class="layui-form" id="form_seartch">

            <div class="layui-inline">
                <div class="layui-input-inline">
                    商户ID：
                </div>
                <div class="layui-input-inline" style="width:80px">
                    <input type="text" class="layui-input UserId" id="UserId" name="UserId" placeholder="商户ID" />
                </div>

                <div class="layui-input-inline">
                    系统订单号：
                </div>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input OrderId" id="OrderId" name="OrderId" placeholder="请输入订单号" />
                </div>

                <div class="layui-input-inline">
                    商户订单号：
                </div>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input MerOrderNo" id="MerOrderNo" name="MerOrderNo" placeholder="请输入商户订单号" />
                </div>

                <div class="layui-input-inline">
                    接口商订单号：
                </div>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input ChannelOrderNo" id="ChannelOrderNo" name="ChannelOrderNo" placeholder="请输入接口订单号" />
                </div>

                <div class="layui-input-inline">
                    下单时间：
                </div>

                <div class="layui-input-inline">
                    <input style="width:150px" class="layui-input" onfocus="WdatePicker({ maxDate: $('#EndTime').val(),dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="@DateTime.Now.ToString("yyyy-MM-dd 00:00:00")" type="text" id="BeginTime" name="BeginTime" />
                </div>
                <div class="layui-input-inline">
                    到
                </div>
                <div class="layui-input-inline">
                    <input style="width:150px" class="layui-input" onfocus="WdatePicker({ minDate: $('#BeginTime').val(),dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="@DateTime.Now.ToString("yyyy-MM-dd 23:59:59")" type="text" id="EndTime" name="EndTime" />
                </div>

                @Html.Hidden("PromId", adminId)

                @*<div class="layui-input-inline">
                        商户类型：
                    </div>
                    <div class="layui-input-inline" style="width:80px">
                        <select id="UserType" name="UserType" lay-verify="" lay-filter="UserType">
                            <option value="-1">请选择</option>
                            <option value="0">个人</option>
                            <option value="1">企业</option>
                        </select>
                    </div>*@

                <div class="layui-input-inline">
                    代理：
                </div>
                <div class="layui-input-inline" style="width:100px">
                    <select name="AgentId" class="AgentId" lay-filter="AgentId">
                        <option value="">请选择代理</option>
                        @foreach (var item in agentList)
                        {
                            <option value="@item.UserId">@item.MerName</option>
                        }
                    </select>
                </div>
                <br>
                @*<div class="layui-input-inline">
                    业务员：
                </div>
                <div class="layui-input-inline" style="width:100px">
                    <select name="PromId" class="PromId" lay-filter="PromId">
                        <option value="">请选择业务员</option>
                        @foreach (var item in adminlist)
                        {
                            <option value="@item.ID">@item.AdmUser</option>
                        }
                    </select>
                </div>*@

                <div class="layui-input-inline">
                    接口商：
                </div>
                <div class="layui-input-inline" style="width:100px">
                    <select name="InterfaceCode" class="InterfaceCode" lay-filter="InterfaceCode">
                        <option value="">请选择接口商</option>
                        @foreach (var item in IBList)
                        {
                            <option value="@item.Code">@item.Name</option>
                        }
                    </select>
                </div>

                <div class="layui-input-inline">
                    支付类型：
                </div>
                <div class="layui-input-inline" style="width:100px">
                    <select id="PayCode" name="PayCode" lay-verify="" lay-filter="PayCode">
                        <option value="">请选择</option>
                        @foreach (var item in paytypelist)
                        {
                            <option value="@item.PayCode">@item.PayName</option>
                        }
                    </select>
                </div>

                <div class="layui-input-inline">
                    支付状态：
                </div>
                <div class="layui-input-inline" style="width:100px">
                    <select id="PayState" name="PayState" lay-verify="" lay-filter="PayState">
                        <option value="-1">请选择</option>
                        <option value="0">处理中</option>
                        <option value="1" selected>已成功</option>
                        <option value="2">失败</option>
                        <option value="3">已过期</option>
                    </select>
                </div>

                <div class="layui-input-inline">
                    通知状态：
                </div>
                <div class="layui-input-inline" style="width:100px">
                    <select id="OrderState" name="OrderState" lay-verify="" lay-filter="OrderState">
                        <option value="-1">请选择</option>
                        <option value="0">处理中</option>
                        <option value="1">成功</option>
                        <option value="2">失败</option>
                    </select>
                </div>
                <a class="layui-btn search_btn" data-type="reload">搜索</a>

                <a class="layui-btn layui-btn-normal" href="/Order/OrderImprotExcel">
                    <i class="layui-icon">&#xe655;</i>导出
                </a>
            </div>

            <div style="vertical-align: middle;">

                <div class="layui-input-inline">
                    订单总额：
                </div>
                <div class="layui-input-inline">
                    <strong id="TotalOrderAmt" class="f-red">0.00</strong>元
                </div>

                <div class="layui-input-inline magleft10">
                    成本金额：
                </div>
                <div class="layui-input-inline">
                    <strong id="TotalCostAmt" class="f-red">0.00</strong>元
                </div>

                <div class="layui-input-inline magleft10">
                    业务提成：
                </div>
                <div class="layui-input-inline">
                    <strong id="TotalPromAmt" class="f-red">0.00</strong>元
                </div>

                <div class="layui-input-inline magleft10">
                    代理收益：
                </div>
                <div class="layui-input-inline">
                    <strong id="TotalAgentAmt" class="f-red">0.00</strong>元
                </div>

                <div class="layui-input-inline magleft10">
                    平台利润：
                </div>
                <div class="layui-input-inline">
                    <strong id="TotalProfits" class="f-red">0.00</strong>元
                </div>
            </div>

        </form>

    </blockquote>
    <table id="OrderList" lay-filter="OrderList"></table>
</div>

